<template>
	<div class="phone-from-view">
		<el-form
			:model="form"
			status-icon
			:rules="rules"
			ref="form"
			label-width="80px"
		>
			<el-form-item label="姓名" prop="name">
				<el-input type="text" v-model="form.name"></el-input>
			</el-form-item>
			<el-form-item label="手机号" prop="phone">
				<el-input type="phone" v-model="form.phone"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="submitForm()">立即提交</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>
<script>
	export default {
		name: "wechat-view",
		props: {
			view: {
				type: Object,
				default: () => ({})
			}
		},
		data() {
			return {
				form: {
					name: "",
					phone: ""
				},
				rules: {
					// name: [{ required: true, message: "请填写姓名" }],
					// phone: [{ required: true, message: "请填写手机号" }],
				}
			};
		},
		computed: {
			options() {
				return this.view.options;
			}
		},
		methods: {
			submitForm(formName) {
				this.$message.success('提交成功！')
				// this.$refs.form.validate(async (valid, errors) => {
				// 	this.showFormErr(errors);
				// 	if (!valid) return;
				// });
			}
		}
	};
</script>
<style lang="scss" scoped>
	.phone-from-view {
		padding: 10px 0;
		padding-right: 10px;
	}
</style>
